<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template index/header}
	<div class="container containerUser fix pt15">
    {template member/slide}
  <div class="userRight">
    <div class="userTitle mgb10">
      投注明细
    </div>
    <div class="userMain mgb10">
      <ul class="todayView mgb10" style="text-align: left;">
        <em>账号：</em><input type="text" placeholder="下级投注查询" class="userInput" id="id_username" value="{$username}">&nbsp;
        <a class="submitBtn" id="id_search">搜索</a>
      </ul>
      	<ul class="searchFirst">
        	<li>
        		<span>彩种：</span>
      			<select class="selectBox" id="id_choice_lott">
          			<option value="0">全部彩票</option>
                  	{loop $lottList as $k => $v}
                  		<option value="{$v['id']}" {if $lott_id == $v['id']} selected="selected" {/if}>{$v['title']}</option>
                  	{/loop}
            	</select>
       		</li>
        	<li class="_time">
        		<span>时间：
        			<a href="javascript:void(0);" class="userSearch time tag_choice_dayline {if !$dayline} active {else} {if $dayline == 1} active {/if} {/if}" ami='1'>今天</a>
        			<a href="javascript:void(0);" class="userSearch time tag_choice_dayline {if $dayline == 2} active {/if}" ami='2'>昨天</a>
        			<a href="javascript:void(0);" class="userSearch time tag_choice_dayline {if $dayline == 3} active {/if}" ami='3'>七天</a>
        		</span>
        	</li>
        	<li class="_state">
        		<span>类型：
        			<a href="javascript:void(0);" class="userSearch time tag_choice_staline {if !$staline} active {else} {if $staline == 1} active {/if} {/if}" ami="1">全部</a>
        			<a href="javascript:void(0);" class="userSearch time tag_choice_staline {if $staline == 2} active {/if}" ami="2">已中奖</a>
        			<a href="javascript:void(0);" class="userSearch time tag_choice_staline {if $staline == 3} active {/if}" ami="3">未中奖</a>
        			<a href="javascript:void(0);" class="userSearch time tag_choice_staline {if $staline == 4} active {/if}" ami="4">等待开奖</a>
        		</span>
        	</li>
      	</ul>
      	<div class="searchDetail">
        	<table>
        		<tbody>
        			<tr>
                      	<th style="width:80px;font-size:12px;">账号</th>
                      	<th style="width:80px;font-size:12px;" colspan="1">彩种</th>
                      	<th style="width:100px;font-size:12px;">期号</th>
                      	<th style="width:100px;font-size:12px;">投注内容</th>
                      	<th style="width:100px;font-size:12px;">投注金额</th>
                      	<th style="width:100px;font-size:12px;">开奖号码</th>
                      	<th style="width:100px;font-size:12px;">奖金状态</th>
                      	<th style="width:100px;font-size:12px;">投注时间</th>
                      	<th style="width:80px;font-size:12px;">操作项</th>
        			</tr>
        		</tbody>
        		<tbody class="Records_listCont">
        			{if $data}
            			{loop $data as $k => $v}
            				<tr style="font-size: 12px;">
            					<td>{$v['username']}</td>
            					<td>{$lottList[$v['lott_id']]['title']}</td>
            					<td>{$v['period']}</td>
            					<td><div class="betNum">{$v['bet_str']}</div></td>
            					<td>{$v['amount']}</td>
            					<td>{$v['open_code']}</td>
            					<td>
            						{if $v['open_code']}
            							{if $v['prize']}
            								{$v['prize']}
            							{else}
            								未中奖
            							{/if}
            						{else}
            							未开奖
            						{/if}
            					</td>
            					<td>{date('y-m-d H:i:s', $v['createtime'])}</td>
            					<td>--</td>
            				</tr>
            			{/loop}
            		{else}
                    	<tr style="border-bottom: 0px;">
                      		<td colspan="100">
                    			<div class="notContent" style="padding: 100px 0px;">
                          			<i class="iconfont"></i>暂无记录
                        		</div>
                      		</td>
                    	</tr>
                	{/if}
                </tbody>
        	</table>
      	</div>
      <div class="page">
        <p>
          共<em>{if $tmp } {count($tmp)} {else}0{/if}</em>条记录
        </p>
        <div id="pageNav" class="pageNav">
          <div id="pageNav" class="pageNav">
            <ul class="pagination" style="display: none;">
              <li style="display: none;"><a>上一页</a></li>
              <li style="display: none;"><a>下一页</a></li>
            </ul>
          </div>
        </div>
      </div>
      <div class="userTip mgt15">
        <p>
          <i></i>温馨提示：投注明细最多只保留7天。
        </p>
      </div>
    </div>
  </div>
</div>
<script>
	var baseUrl  = "{U('member/agentBetRecord')}";
	var staline  = '';
	var dayline  = '';
	var username = '';
	$('#id_choice_lott').on('change', '', function (){
		$.each($('.tag_choice_staline'), function (i, v){
			if($(v).hasClass('active')){
				staline = $(v).attr('ami');
				return false;
			}
		})
		$.each($('.tag_choice_dayline'), function (i, v){
			if($(v).hasClass('active')){
				dayline = $(v).attr('ami');
				return false;
			}
		})
		window.location = baseUrl + "&lott_id=" + $(this).val() + '&dayline=' + dayline + '&staline=' + staline + '&username=' + $('#id_username').val();
	})
	$('.tag_choice_dayline').on('click', '', function (){
		$.each($('.tag_choice_staline'), function (i, v){
			if($(v).hasClass('active')){
				staline = $(v).attr('ami');
				return false;
			}
		})
		window.location = baseUrl + "&lott_id=" + $('#id_choice_lott').val() + '&dayline=' + $(this).attr('ami') + '&staline=' + staline + '&username=' + $('#id_username').val();
	})
	
	$('.tag_choice_staline').on('click', '', function (){
		$.each($('.tag_choice_dayline'), function (i, v){
			if($(v).hasClass('active')){
				dayline = $(v).attr('ami');
				return false;
			}
		})
		window.location = baseUrl + "&lott_id=" + $('#id_choice_lott').val() + '&staline=' + $(this).attr('ami') + '&dayline=' + dayline + '&username=' + $('#id_username').val();
	})
	$('#id_search').on('click', '', function (){
		$.each($('.tag_choice_staline'), function (i, v){
			if($(v).hasClass('active')){
				staline = $(v).attr('ami');
				return false;
			}
		})
		$.each($('.tag_choice_dayline'), function (i, v){
			if($(v).hasClass('active')){
				dayline = $(v).attr('ami');
				return false;
			}
		})
		window.location = baseUrl + "&lott_id=" + $('#id_choice_lott').val() + '&dayline=' + dayline + '&staline=' + staline + '&username=' + $('#id_username').val();
	})
</script>
{template index/footer}